Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Kuwait Theme: Radio group styling #2737

Merged
merged 20 commits into from
Feb 19, 2025

Conversation

FaithDaka
Copy link
Collaborator

@FaithDaka FaithDaka commented Jan 21, 2025

19/02/25 UPDATED by @jfmcquade:

PR Checklist

  • PR title descriptive (can be used in release notes)

Description

Adds additional parameter options for the radio_button_grid component:

  • New variant: flex
    • Arranges the items in a "flexbox" layout
    • Parameters item_width (taken to be minimum item width) and grid_gap are still applied for this variant
  • New style: secondary
    • Applies secondary colour styling to the items
    • Style variables are exposed to theming

As these are independent of each other, they can be set in any combination. E.g. an instance of the component with the default variant (grid) can have style: secondary applied.

At the bottom of the demo sheet is an example of the configuration to achieve the requested use case in #2641.

Git Issues

Closes #2641

Screenshots

comp_radio_button_grid

Screenshot 2025-02-19 at 10 14 29

Demo by theme:

default professional pfr plh_facilitator_mx early_family_math plh_kids_kw plh_kids_tz
Screenshot 2025-02-19 at 11 43 41 Screenshot 2025-02-19 at 11 43 53 Screenshot 2025-02-19 at 11 44 04 Screenshot 2025-02-19 at 11 44 15 Screenshot 2025-02-19 at 11 44 25 Screenshot 2025-02-19 at 11 44 37 Screenshot 2025-02-19 at 11 44 49

@FaithDaka FaithDaka added the feature Work on app features/modules label Jan 21, 2025
@FaithDaka FaithDaka added this to the ParentApp Kids KW Dec 2024 milestone Jan 21, 2025
@FaithDaka FaithDaka self-assigned this Jan 21, 2025
@FaithDaka FaithDaka linked an issue Jan 21, 2025 that may be closed by this pull request
Copy link
Collaborator

@jfmcquade jfmcquade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, nice to have the differences scoped entirely to the CSS styles.

See my inline comments: I think the flex/grid should be set through the variant rather than style param. But if there's not time to fix before a release is needed, I'm happy to merge as-is

@FaithDaka
Copy link
Collaborator Author

Changes made @jfmcquade

@jfmcquade jfmcquade self-requested a review January 23, 2025 14:55
Copy link
Collaborator

@jfmcquade jfmcquade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the updates. I've added some minor comments inline, but I've also noticed an issue with the comp_radio_button_grid demo template: the text of the second button, which wraps over three lines, is obscured by the image:

Screenshot 2025-01-23 at 14 54 14

@esmeetewinkel
Copy link
Collaborator

I'll review this when code review has passed, @FaithDaka could you check me again when @jfmcquade has approved?

@jfmcquade
Copy link
Collaborator

@esmeetewinkel I've updated the PR and description following our conversation, should now be ready for testing

Copy link

github-actions bot commented Feb 19, 2025

Visit the preview URL for this PR (updated for commit 4a63a85):

https://plh-teens-app1--pr2737-bug-kw-radio-group-s-4s48mh5m.web.app

(expires Wed, 05 Mar 2025 15:43:43 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e4c0bab6b08dd290fbf002fd6e07987fa4b5fce1

Copy link
Collaborator

@esmeetewinkel esmeetewinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

  • When only images or only text are provided, the button height should adapt to the content.
  • I had understood item-width is a min width, but it seems to behave more like a max width in the flex case (or at least setting is causes narrower buttons).

Screenshot in debug deployment:
image

Screenshots in plh_kids_kw deployment:
(without specifying item_width)
image

(specifying item_width: 96px)
image

@jfmcquade
Copy link
Collaborator

jfmcquade commented Feb 19, 2025

Thanks!

  • When only images or only text are provided, the button height should adapt to the content.

Good point, fixed with 0901aa2

  • I had understood item-width is a min width, but it seems to behave more like a max width in the flex case (or at least setting is causes narrower buttons).

Ah, this is because the default min-width, used if none was specified, was set larger than 96px. I've updated now so that it should behave as expected.

0901aa2 also includes changes to make the items more likely to wrap onto a single line, as they were taking up a lot of space. Part of this is reducing the image size (to the app-wide maximum heigh for icons). Let me know if this looks right or if the image size should be tweaked

Screenshot 2025-02-19 at 15 32 40

Copy link
Collaborator

@esmeetewinkel esmeetewinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making those final changes. Looks very much like the design to me!

image image

image

@esmeetewinkel esmeetewinkel merged commit 9817b20 into master Feb 19, 2025
8 checks passed
@esmeetewinkel esmeetewinkel deleted the bug-kw-radio-group-styling branch February 19, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Work on app features/modules test - preview Create a preview deployment of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] KW radio group styling
3 participants